package vn.edu.saigontech.ncms.web.receipt.report;

import java.util.Date;
import java.util.List;

import vn.edu.saigontech.ncms.model.info.ReceiptRefund;
import vn.edu.saigontech.ncms.model.system.Parameter;
import vn.edu.saigontech.ncms.service.ParameterService;
import vn.edu.saigontech.ncms.service.ReceiptRefundService;
import vn.edu.saigontech.ncms.util.DateUtil;
import vn.edu.saigontech.ncms.util.I18n;

public class RefundReport {
	private String fromDate;
	private String toDate;
	List<ReceiptRefund> refunds;
	private String pcl;
	private String lep;
	private String rrp;
	
	public RefundReport(Date fromDate, Date toDate) {
		this.fromDate = DateUtil.toString(fromDate, new I18n().getMessage("format.vndate"));
		this.toDate = DateUtil.toString(toDate, new I18n().getMessage("format.vndate"));
		this.init(fromDate, toDate);
	}
	
	private void init(Date fromDate, Date toDate) {
		refunds = ReceiptRefundService.INSTANCE.findByDate(fromDate, toDate);
		this.lep = ParameterService.INSTANCE.findText(Parameter.LEP);
		this.pcl = ParameterService.INSTANCE.findText(Parameter.PCL);
		this.rrp = ParameterService.INSTANCE.findText(Parameter.RRP);
	}

	public String getFromDate() {
		return fromDate;
	}

	public void setFromDate(String fromDate) {
		this.fromDate = fromDate;
	}

	public String getToDate() {
		return toDate;
	}

	public void setToDate(String toDate) {
		this.toDate = toDate;
	}

	public String getPcl() {
		return pcl;
	}

	public void setPcl(String pcl) {
		this.pcl = pcl;
	}

	public String getRrp() {
		return rrp;
	}

	public void setRrp(String rrp) {
		this.rrp = rrp;
	}

	public List<ReceiptRefund> getRefunds() {
		return refunds;
	}

	public void setRefunds(List<ReceiptRefund> refunds) {
		this.refunds = refunds;
	}

	public String getLep() {
		return lep;
	}

	public void setLep(String lep) {
		this.lep = lep;
	}
}
